import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/sys/account/base/list',
    method: 'get',
    params: query
  })
}

export function fetchAccount(id) {
  return request({
    url: '/sys/account/base/one',
    method: 'get',
    params: { id }
  })
}

export function createAccount(data) {
  return request({
    url: '/sys/account/base',
    method: 'post',
    data
  })
}

export function updateAccount(data) {
  return request({
    url: '/sys/account/base',
    method: 'put',
    data
  })
}

export function login(data) {
  return request({
    url: '/sys/account/login',
    method: 'post',
    params: data
  })
}

export function logout() {
  return request({
    url: '/sys/account/logout',
    method: 'post'
  })
}
